package com.cloud.spring.demo.controller;

import com.cloud.spring.demo.entity.User;
import com.cloud.spring.demo.service.UserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Log4j2
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    UserService service;

    @GetMapping("insert")
    public int insert(User user) {
        return service.insert(user);
    }

    @GetMapping("select")
    public User select() {
        return service.select();
    }
}
